home *** CD-ROM | disk | FTP | other *** search
/ Building Homes of Our Own / Building Homes of our Own.iso / setup / data1.cab / Everything / working / houCons.dxr / interface_5_evaluateFloorPlan().ls < prev    next >
Encoding:
Text File  |  2002-09-25  |  1.9 KB  |  58 lines

  1. on evaluateFloorPlan
  2.   global gUserDataMan, gIso
  3.   if not objectp(gIso) then
  4.     return #isoEngineNotInstantiated
  5.   end if
  6.   problemList = []
  7.   totalFloors = getTotalFloors(gUserDataMan)
  8.   totalTilesMan = new(script("totalTileManager"))
  9.   numTilesInHouse = getNumTilesInHouse(totalTilesMan)
  10.   totalTilesMan = VOID
  11.   subdivisionsUsedList = getUsedSubdivisions(gIso)
  12.   bathroomTileList = [#a196, #a184, #a185, #a186, #a187]
  13.   kitchenTileList = [#a191]
  14.   subDivisionsInUse = [#a172, #a173, #a174, #a175, #a176, #a177, #a178, #a179, #a180, #a181, #a182, #a183, #a184, #a185, #a186, #a187, #a188, #a189, #a190, #a191, #a192, #a193, #a194, #a195, #a196]
  15.   numTilesUsed = 0
  16.   kitchenThere = 0
  17.   bathroomThere = 0
  18.   numListItems = count(subdivisionsUsedList)
  19.   repeat with x = 1 to numListItems
  20.     thisItem = getPropAt(subdivisionsUsedList, x)
  21.     if not getOne(subDivisionsInUse, thisItem) then
  22.       next repeat
  23.     end if
  24.     thisAmount = getAt(subdivisionsUsedList, x)
  25.     if thisAmount > 0 then
  26.       numTilesUsed = numTilesUsed + thisAmount
  27.       if getOne(bathroomTileList, thisItem) then
  28.         bathroomThere = 1
  29.       end if
  30.       if getOne(kitchenTileList, thisItem) then
  31.         kitchenThere = 1
  32.       end if
  33.     end if
  34.   end repeat
  35.   floorPlanTrackingList = getFloorPlanTrackingList(gUserDataMan)
  36.   if voidp(floorPlanTrackingList) then
  37.     floorPlanTrackingList = [#exteriorDoor: 0, #staircase: 0]
  38.   end if
  39.   if floorPlanTrackingList[#exteriorDoor] < 1 then
  40.     append(problemList, #ExtDoorMissing)
  41.   end if
  42.   if totalFloors > 1 then
  43.     if floorPlanTrackingList[#staircase] < 1 then
  44.       append(problemList, #stairCaseMissing)
  45.     end if
  46.   end if
  47.   if not kitchenThere then
  48.     append(problemList, #KitchenMissing)
  49.   end if
  50.   if not bathroomThere then
  51.     append(problemList, #BathroomMissing)
  52.   end if
  53.   if numTilesInHouse > numTilesUsed then
  54.     append(problemList, #UnassignedSpace)
  55.   end if
  56.   return problemList
  57. end
  58.